//
//  openclconvolutioner.h
//  LowPassFilter_Standalone
//
//  Created by kadlubek47 on 16.04.2013.
//  Copyright (c) 2013 kadlubek47. All rights reserved.
//

#ifndef __LowPassFilter_Standalone__OpenCLConvolutioner__
#define __LowPassFilter_Standalone__OpenCLConvolutioner__

/*
 * - is it possible not to pass to GPU all the time h?
 *
 */

// OpenCL includes
#include <OpenCL/cl.h>

//
#include "LPF_Types.h"
#include "ProcessInterface.h"
#include "OpenCLProcessorBase.h"

class OpenCLConvolutioner: public ProcessInterface, public OpenCLProcessorBase
{
public:
    
	OpenCLConvolutioner();
	~OpenCLConvolutioner();
    
	/*   virtual from base class ProcessInterface   */
    void process(float_type* x, unsgn_integer_type x_size, float_type* h, unsgn_integer_type M, float_type* y);

private:
    
    void createKernel();
    
    //Buffers
    cl_mem buffer_h_, buffer_M_, buffer_x_, buffer_y_;
    bool buffersFirstTimeSet = false;
    unsgn_integer_type x_size_, M_, h_size_, y_size_;
    
    void setSizeOfDeviceBuffers(unsgn_integer_type x_size, unsgn_integer_type M);
    //.

    
    //Context, command queue, devices, source code, kernels, 
    cl_kernel kernel_;
    //.
    
}; 


#endif /* defined(__LowPassFilter_Standalone__OpenCLConvolutioner
__) */
